{include file="admin/public/header" /}
<div class="aw-content-wrap" style="padding:10px;">
    <form action="/admin/ajax/save_hook.html" class="cmzForm" method="post" onsubmit="return false">
    <div class="mod">
                <div class="ibox-title">
            <h3>
                <span class="pull-left">编辑勾子</span>

                <span class="pull-right"><a href="{:url('admin/addons/hooks')}" class="btn btn-xs btn-primary mod-site-save">勾子列表</a></span>
            </h3>
        </div>
        <div class="tab-content mod-content">
            <table class="table table-striped">
                <tbody>
                
              
            
                <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label">钩子名称:</span>
                            <div class="col-sm-5 col-xs-8">
                                <input name="name" class="form-control" value="{$hook.name}" type="text">
                                  <span class="help-block">需要在程序中先添加钩子，否则无效['一般为英文']</span>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label">钩子描述:</span>
                            <div class="col-sm-5 col-xs-8">
                            <textarea class="form-control" name="description"  id="" cols="5" rows="3">{$hook.description}</textarea>
                                <!-- <input name="description" class="form-control" value="10" type="text"> -->

                               
                            </div>
                        </div>
                    </td>
                </tr>

                 <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label">钩子类型:</span>
                            <div class="col-sm-5 col-xs-8">
                                <select name="type" class="form-control" id="">
                                	<option value="1" <?php if($hook['type']=="1"){ ?> selected='selected' <?php } ?>>视图</option>
                                	<option value="2" <?php if($hook['type']=="2"){ ?> selected='selected' <?php } ?>>控制器</option>
                                </select>

                            </div>
                        </div>
                    </td>
                </tr>

                 <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label">绑定插件:</span>
                            <div class="col-sm-5 col-xs-8">
	 							<div class="form-group">
	                            <!-- <label class="font-noraml">绑定插件</label> -->
	                            <div class="input-group">
	                                <select data-placeholder="选择省份" class="chosen-select form-control" multiple style="width:100%" name="addons" tabindex="4">
	                               <?php foreach ($addonsList as $key => $v): ?>
	                                    <option value="{$v.name}" <?php if(in_array($v['name'], $hook['addonss'])){ ?> selected="selected" <?php } ?> >{$v.title}</option>
	                                 <?php endforeach ?>
	                                    
	                                </select>
	                            </div>
	                        </div>
                               
                            </div>
                        </div>
                    </td>
                </tr>

                 <tr>
                    <td>
                        <div class="form-group">
                            <span class="col-sm-3 col-xs-3 control-label">状态:</span>
                            <div class="col-sm-5 col-xs-8">
                                <select name="status" class="form-control" id="">
                                	<option value="1" <?php if($hook['status']=="1"){ ?> selected='selected' <?php } ?> >开启</option>
                                	<option value="0" <?php if($hook['status']=="0"){ ?> selected='selected' <?php } ?> >禁用</option>
                                </select>
                            </div>
                        </div>
                    </td>
                </tr>
                
               
             
        

            </tbody></table>
        </div>

        <div class="hr-line-dashed"></div>
       <div class="form-group">
        <div class="">
        <input type="hidden" value="{$hook.id}" name="id">
         <a href="javascript:;" class="btn btn-sm btn-primary pull-left m-t-n-xs cmzPost" style="margin-top:20px;"><strong>提交配置</strong></a>
        </div>
    </div>
    </div>
    </form>
</div>